package Visitor.Before;

import java.util.ArrayList;
import java.util.List;

/**
 * The strategy pattern is the cousin of the visitor pattern.
 * The strategy pattern lets you do some behavior dynamically.
 * You just plop in a new strategy and get new results.
 *
 * A visitor is different. It basically lets you have virtual
 * functions or functions outside of a particular Object.
 * It's mostly useful if you have a group of objects that you
 * want to add some functionality to but don't want to create
 * the methods inside of them themselves.
 *
 * Why would you want to do that? Simply because it makes sense
 * to. What if you want to do reporting on a bunch of objects.
 * If you have to modify an object every time then it's not good.
 * Especially if you have to modify 20 of them every time.
 *
 * Lets take a look at calculating how many more times an
 * enemy can be hit or not. We use this to determine how weak
 * his meter is. How many more hits he can take is determined
 * by the strength of the user's weapon and his health, as well
 * as other factors such as how much this player can...
 *
 * After looking at the code: you might say "Okay I see, makes
 * sense. Of course I want to do this." Then your boss tells
 * you the news that suprise you also need to add in the ability
 * to
 *
 */
public class Game
{
    public static void main( String[] args )
    {
        List<Enemy> enemies = new ArrayList<Enemy>();

        for( Enemy enemy : enemies )
        {

        }
    }
}

abstract class Enemy
{
    int hitPoints;

    abstract int getTotalHitPointsLeft( int pointsPerHit );
}

/**
 * Very resiliant guy. He's used to the pain of his own stink
 * so your sword can't hurt him much. Makes perfect sense!
 */
class StinkyEnemy extends Enemy
{

    @Override
    int getTotalHitPointsLeft( int pointsPerHit )
    {
        return hitPoints / ( pointsPerHit / 2 );
    }
}
/**
 * Poor vision is killing this guy. He doesn't even know
 * where you are half the time, so each time you hit him
 * you get even more than normal damage.
 */
class OneEyedEnemy extends Enemy
{
    @Override
    int getTotalHitPointsLeft( int pointsPerHit )
    {
        return hitPoints / ( pointsPerHit * 2 );
    }
}

/**
 * This primate is a major pain in the butt. He won't
 * stop hopping around and smacking you with bananas,
 * which makes it tough to hit him. When you do you
 * aren't getting in good shots you
 */
class MonkeyEnemy extends Enemy
{

    @Override
    int getTotalHitPointsLeft( int pointsPerHit )
    {
        return hitPoints / ( pointsPerHit / 20 );
    }
}
